class Singlelaze {

    private static volatile Singlelaze singlelaze = null;
    private static Object locker = new Object();

    private Singlelaze() {

    }

    public static Singlelaze getInstance() {

        if (singlelaze == null) {
            synchronized(locker) {
                if (singlelaze == null) {
                    singlelaze = new Singlelaze();
                }
            }
        }


        return singlelaze;
    }
}

public class Demo1 {

    public static void main(String[] args) {

        Singlelaze singlelaze = Singlelaze.getInstance();
    }
}
